/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.jiadakeji.ppm.modules.business.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jiadakeji.ppm.common.persistence.DataEntity;
import com.jiadakeji.ppm.common.utils.DateUtils;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 缴费月份Entity
 * @author HHAOYU
 * @version 2019-07-09
 */
public class FeeMonth extends DataEntity<FeeMonth> {
	
	private static final long serialVersionUID = 1L;
	private Date currentMonth;		// 当前月份
	private Date startDate;		// 开始时间
	private Date endDate;		// 结束时间
	private String isCurrent;		// 是否当前月份
	private String monthString;


	
	public FeeMonth() {
		super();
	}

	public FeeMonth(String id){
		super(id);
	}

	@JsonFormat(pattern = "yyyy-MM")
	public Date getCurrentMonth() {
		return currentMonth;
	}

	public void setCurrentMonth(Date currentMonth) {
		this.currentMonth = currentMonth;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	@Length(min=0, max=1, message="是否当前月份长度必须介于 0 和 1 之间")
	public String getIsCurrent() {
		return isCurrent;
	}

	public void setIsCurrent(String isCurrent) {
		this.isCurrent = isCurrent;
	}

	public String getMonthString() {
		return DateUtils.formatDate(currentMonth,"yyyy-MM");
	}

	public void setMonthString(String monthString) {
		this.monthString = monthString;
	}
}